﻿CREATE PROCEDURE [dbo].[GetStockByType] 
	@StockType VARCHAR(50),
	@Filter VARCHAR(255)
AS

SELECT s.StockId, RTRIM(s.Code) [Code], s.[Description], s.[Weight], s.SizeX, s.SizeY, s.Facing, s.Colour
FROM dbo.Stock [s]
INNER JOIN dbo.StockType [st] ON st.StockTypeID = s.StockTypeID
WHERE st.StockType = @StockType AND s.[Description] LIKE @Filter
ORDER BY s.Code, s.[Description]